//
// Created by 33145 on 2023/6/1.
//

#ifndef ROCKET_IO_THREAD_GROUP_H
#define ROCKET_IO_THREAD_GROUP_H

#include <vector>
#include <memory>

#include "io_thread.h"

namespace rocket {
  class IOThreadGroup {
  public:
    typedef std::shared_ptr<IOThreadGroup> ptr;
    explicit IOThreadGroup(int size);
    ~IOThreadGroup() = default;

    void start();
    void join();

    IOThread::ptr getIOThread();

  private:
    int _size {0};
    int _index {0};
    std::vector<IOThread::ptr> _io_thread_groups;
  };
}

#endif //ROCKET_IO_THREAD_GROUP_H
